﻿using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using vite_ef.Repositories.EntityFrameworkCore;
using vite_entity.Entities;
using vitecore.Module;

namespace vite_services
{
    [InjectOn(ServiceLifetime.Scoped, Scheme = InjectScheme.None, Own = true)]
    public class SystemServices
    {
        private readonly IBaseRepository<SysLog> _baseLogRepository;

        public SystemServices(IBaseRepository<SysLog> baseLogRepository)
        {
            _baseLogRepository = baseLogRepository;
        }

        /// <summary>
        /// 记录日志
        /// </summary>
        /// <param name="sysLog"></param>
        /// <returns></returns>
        public async Task AddLogAsync(SysLog sysLog)
        {
            await _baseLogRepository.AddAsync(sysLog);
        }
    }
}
